export interface IExam {
  _id?: string;
  exam_name: string;
  description: string;
  start_time: Date;
  end_time: Date;
  paper: string;
  is_enabled: boolean;
  participation_limit?: number;
  allow_retake: boolean;
  creator?: string;
  create_time?: Date;
}
export interface IExamFE
  extends Omit<IExam, 'start_time' | 'end_time' | 'create_time'> {
  start_time: string;
  end_time: string;
  create_time?: string;
}


export type ExamStatus = "in_progress" | "completed" | "timeout";

export interface IExamRecord {
  _id: string;
  user_id: string;
  exam_id: string;
  start_time: Date;
  submit_time?: Date;
  answers: {
    question_id: string;
    question_snapshot?: {
      content: string;
      type: string;
      options: Array<{
        symbol: string;
        content: string;
      }>;
      correct_answer: number[];
      score: number;
      difficulty?: string;
    };
    selected_answers: number[]; // 用户选择的答案索引
    is_correct?: boolean;
    earned_score?: number;
  }[];
  score?: number;
  total_score?: number;
  user_score?: number;
  correct_count?: number;
  wrong_count?: number;
  unanswered_count?: number;
  is_timeout: boolean;
  status: ExamStatus;
}
